home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / dev / misc / gms_dev.lha / GMSDev / Includes / graphics / screens.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-10-23  |  7.8 KB  |  216 lines

  1. #ifndef GRAPHICS_SCREENS_H
  2. #define GRAPHICS_SCREENS_H TRUE
  3.  
  4. /*
  5. **  $VER: screens.h
  6. **
  7. **  Screen Definitions
  8. **
  9. **  (C) Copyright 1996-1998 DreamWorld Productions.
  10. **      All Rights Reserved.
  11. */
  12.  
  13. #ifndef DPKERNEL_H
  14. #include <dpkernel/dpkernel.h>
  15. #endif
  16.  
  17. /****************************************************************************
  18. ** Screen Object.
  19. */
  20.  
  21. #define VER_SCREEN  2
  22. #define TAGS_SCREEN ((ID_SPCTAGS<<16)|ID_SCREEN)
  23.  
  24. typedef struct GScreen {
  25.   struct Head Head;        /* [00] Standard structure header */
  26.   APTR   MemPtr1;          /* [12] Ptr to screen 1 */
  27.   APTR   MemPtr2;          /* [16] Ptr to screen 2 (double buffer) */
  28.   APTR   MemPtr3;          /* [20] Ptr to screen 3 (triple buffer) */
  29.   struct GScreen *Link;    /* [24] Reserved */
  30.   struct Raster  *Raster;  /* [28] Ptr to a raster object */
  31.   WORD   Width;            /* [32] The width of the visible screen */
  32.   WORD   Height;           /* [34] The height of the visible screen */
  33.   WORD   XOffset;          /* [36] Hardware co-ordinate for TOS */
  34.   WORD   YOffset;          /* [38] Hardware co-ordinate for LOS */
  35.   WORD   BmpXOffset;       /* [40] Offset of the horizontal axis */
  36.   WORD   BmpYOffset;       /* [42] Offset of the vertical axis */
  37.   WORD   ScrMode;          /* [44] What screen mode is it? */
  38.   WORD   reserved;         /* [46] Reserved. */
  39.   LONG   Attrib;           /* [48] Special Attributes are? */
  40.   struct DPKTask *prvTask; /* [52] Private */
  41.   struct Bitmap  *Bitmap;  /* [56] Bitmap */
  42.   WORD   Switch;           /* [60] R: Set to switch the buffers */
  43.  
  44.   /* Private fields */
  45.  
  46.   WORD   prv;                  /* */
  47.   APTR   prvTypeEmulator;      /* Emulation */
  48.   APTR   prvMonitor;           /* Monitor driver */
  49.   APTR   prvEMemPtr1;          /* Chunky driver */
  50.   APTR   prvEMemPtr2;          /* Chunky driver */
  51.   APTR   prvEMemPtr3;          /* Chunky driver */
  52.   APTR   prvEFree1;            /* Chunky driver */
  53.   APTR   prvEFree2;            /* Chunky driver */
  54.   APTR   prvEFree3;            /* Chunky driver */
  55.   BYTE   prvColBits;           /* 0 = 12bit, 1 = 24bit */
  56.   BYTE   prvPad;               /* Unused */
  57.   LONG   prvShowKey;           /* Resource key if the screen is shown */
  58.   LONG   prvScratch;           /* Scratch address! */
  59.   struct ScreenPrefs *Prefs;   /* Screen preferences for this screen */
  60.   APTR   prvLineWait;          /* Line Wait till bitplanes start */
  61.   WORD   *prvEnd;              /* Ptr to the copper's jump end */
  62.   WORD   prvBurstLevel;        /* FMode setting for bitplanes */
  63.   struct Control *prvControl;  /* BPLCON0 */
  64.   APTR   prvModulo;            /* The screen modulo */
  65.   APTR   prvScrPosition;       /* DIW's, DDF's, DIWHIGH */
  66.   APTR   prvStart;             /* Start of main copperlist */
  67.   APTR   prvSprites;           /* Pointer to the copper sprites */
  68.   APTR   prvColours;           /* Pointer to the copper colours */
  69.   WORD   prvAmtBankCols;       /* Amount of colours per bank (AGA) */
  70.   WORD   prvAmtBanks;          /* Amount of banks in total (AGA) */
  71.   WORD   prvHiLoOffset;        /* Offset between hi and lo bits (AGA) */
  72.   BYTE   *prvBitplanes1;       /* Ptr to copper bitplane loaders #1 */
  73.   BYTE   *prvBitplanes2;       /* Ptr to copper bitplane loaders #2 */
  74.   BYTE   *prvBitplanes3;       /* Ptr to copper bitplane loaders #3 */
  75.   LONG   prvColListJmp;        /* Offset to RasterList */
  76.   LONG   prvBmpXOffset;        /* X offset for scrolling */
  77.   LONG   prvBmpYOffset;        /* Y offset for scrolling */
  78.   WORD   prvScrollBWidth;      /* Set to 2 if scrolling */
  79.   APTR   prvMemPtr1;           /* Original screen mem start (1) */
  80.   APTR   prvMemPtr2;           /* Original screen mem start (2) */
  81.   APTR   prvMemPtr3;           /* Original screen mem start (3) */
  82.   WORD   prvBPLCON3;           /* BPLCON3 actual data (not a ptr) */
  83.   WORD   prvAmtFields;         /* Amount of PlayFields on screen */
  84.   WORD   prvFieldNum;          /* Number of this field */
  85.   WORD   prvScrLRWidth;        /* ScrWidth, in lo-resolution */
  86.   WORD   prvScrLRBWidth;       /* ScrByteWidth, in lo-resolution */
  87.   WORD   prvPicLRWidth;        /* PicWidth, in lo-resolution */
  88.   WORD   prvTOSX;              /* Top of screen X for this screen */
  89.   WORD   prvTOSY;              /* Top of screen Y for this screen */
  90.   APTR   prvCopperMem;         /* Pointer to original screen mem start */
  91.   struct Bitmap *prvBitmap;    /* Allocated bitmap */
  92.   WORD   prvBlitXOffset;       /* Offset to use for blitting (hard-scroll) */
  93.   LONG   *prvPalette;          /* Allocated palette */
  94.   APTR   prvBufPtr1;           /* */
  95.   APTR   prvBufPtr2;           /* */
  96.   APTR   prvBufPtr3;           /* */
  97.   APTR   prvRastport;          /* Private rastport pointer */
  98. } OBJScreen;
  99.  
  100. /* Screen Buffer names, these are asked for in the blitter functions */
  101.  
  102. #define BUFFER1  12
  103. #define BUFFER2  16
  104. #define BUFFER3  20
  105.  
  106. /* SCREEN ATTRIBUTES (Attrib) */
  107.  
  108. #define SCR_DBLBUFFER    0x00000001   /* For double buffering */
  109. #define SCR_TPLBUFFER    0x00000002   /* Triple buffering!! */
  110. /*#define SCR_PLAYFIELD  0x00000004    Set if it's part of a playfield */
  111. #define SCR_HSCROLL      0x00000008   /* Gotta set this to do scrolling */
  112. #define SCR_VSCROLL      0x00000010   /* For vertical scrolling */
  113. /*#define SCR_SPRITES    0x00000020    Set this if you want sprites */
  114. #define SCR_SBUFFER      0x00000040   /* Create a buffer for horiz scrolling */
  115. #define SCR_CENTRE       0x00000080   /* Centre the screen (sets XOffset/YOffset) */
  116. #define SCR_BLKBDR       0x00000100   /* Gives a blackborder on AGA machines */
  117. #define SCR_NOSCRBDR     0x00000200   /* For putting sprites in the border */
  118.  
  119. /* SCREEN MODES (ScrMode) */
  120.  
  121. #define SM_HIRES   0x0001       /* High resolution */
  122. #define SM_SHIRES  0x0002       /* Super-High resolution */
  123. #define SM_LACED   0x0004       /* Interlaced */
  124. #define SM_LORES   0x0008       /* Low resolution (default) */
  125. #define SM_SLACED  0x0020       /* Super-Laced resolution */
  126.  
  127. /* Screen Tags */
  128.  
  129. #define GSA_MemPtr1    (12|TAPTR)
  130. #define GSA_MemPtr2    (16|TAPTR)
  131. #define GSA_MemPtr3    (20|TAPTR)
  132. #define GSA_Raster     (28|TAPTR)
  133. #define GSA_Width      (32|TWORD)
  134. #define GSA_Height     (34|TWORD)
  135. #define GSA_XOffset    (36|TWORD)
  136. #define GSA_YOffset    (38|TWORD)
  137. #define GSA_BmpXOffset (40|TWORD)
  138. #define GSA_BmpYOffset (42|TWORD)
  139. #define GSA_ScrMode    (44|TWORD)
  140. #define GSA_Attrib     (48|TLONG)
  141. #define GSA_BitmapTags (56|TSTEPIN)
  142.  
  143. /****************************************************************************
  144. ** Raster object.
  145. */
  146.  
  147. #define VER_RASTER  1
  148. #define TAGS_RASTER ((ID_SPCTAGS<<16)|ID_RASTER)
  149.  
  150. typedef struct Raster {
  151.   struct Head Head;        /* [00] Standard header */
  152.   struct RHead   *Command; /* [12] Pointer to the first command */
  153.   struct GScreen *Screen;  /* [16] Pointer to our Screen owner */
  154.   LONG   Flags;            /* [20] Special flags */
  155.  
  156.   /*** Private fields ***/
  157.  
  158.   APTR   prvRasterMem;
  159. } OBJRaster;
  160.  
  161. #define RSF_DISPLAYED 0x00000001   /* If the raster is currently on display */
  162.  
  163. /****************************************************************************
  164. ** Rasterlist command header format.
  165. */
  166.  
  167. struct RStats {
  168.   LONG  CopSize;
  169.   UWORD *CopPos;
  170. };
  171.  
  172. struct RHead {
  173.   WORD   ID;
  174.   WORD   Version;
  175.   struct RStats *Stats;
  176.   struct RHead  *Prev;
  177.   struct RHead  *Next;
  178. };
  179.  
  180. /****************************************************************************
  181. ** These are the raster command structures.
  182. */
  183.  
  184. #define ID_RASTWAIT       1
  185. #define ID_RASTFLOOD      2
  186. #define ID_RASTCOLOUR     3
  187. #define ID_RASTCOLOURLIST 4
  188. #define ID_RASTMIRROR     5
  189.  
  190. #define ID_RASTEND        6
  191.  
  192. typedef struct RWait {
  193.   struct RHead Head;
  194.   WORD   Line;
  195. } RMD_WAIT;
  196.  
  197. typedef struct RFlood {
  198.   struct RHead Head;
  199. } RMD_FLOOD;
  200.  
  201. typedef struct RColour {
  202.   struct RHead Head;
  203.   LONG   Colour;
  204.   LONG   Value;
  205. } RMD_COLOUR;
  206.  
  207. typedef struct RColourList {
  208.   struct RHead Head;
  209.   WORD   YCoord;
  210.   WORD   Skip;
  211.   LONG   Colour;
  212.   LONG   *Values;
  213. } RMD_COLOURLIST;
  214.  
  215. #endif /* GRAPHICS_SCREENS_H */
  216.